# Maintainer: Felix Yan <felixonmars@archlinux.org>

pkgname=python-pip-run
pkgver=9.2.1
_commit=f7a249371a1b67ff05b729043c300f6b8d74a9b8
pkgrel=3
pkgdesc="Install packages and run Python with them"
url="https://github.com/jaraco/pip-run"
license=('MIT')
arch=('any')
depends=('python-autocommand' 'python-packaging' 'python-path' 'python-pip' 'python-more-itertools'
         'python-jaraco.context' 'python-jaraco.text')
makedepends=('git' 'python-build' 'python-installer' 'python-setuptools-scm' 'python-wheel')
checkdepends=('python-pytest' 'jupyter-nbformat' 'python-pytest-enabler' 'python-jaraco.path')
source=("git+https://github.com/jaraco/pip-run.git#commit=$_commit")
sha512sums=('SKIP')

build() {
  cd pip-run
  python -m build -wn
}

check() {
  cd pip-run
  python -m pytest
}

package() {
  cd pip-run
  python -m installer --destdir="$pkgdir" dist/*.whl
  install -Dm644 LICENSE -t "$pkgdir"/usr/share/licenses/$pkgname/
}
